import bindBoxCard from "./bindBoxCard/index";
import payKeyboard from "components/payKeyboard";
import issueGoods from "./issueGoods/index";
export default {
  data() {
    return {
      overlayShow: false, //开奖弹出层

      drawShow: false,
      allDataList: [],
      activeIndex: 0,
      inShow: false,
      newBlindBoxData:{}, //开箱弹窗数据
    };
  },
  activated() {
    this.getData();
  },
  methods: {
    async getData() {
      let data = await $http.post("plugin.new-blind-box.frontend.activity.open-box-page", {order_id: this.$route.params.order_id});
      // console.log(data,'datadatadatadata');
      if (data.result) {
        this.allDataList = {
          list: [{...data.data.activity,goods: data.data.goods}],
          ...data.data
        }
        this.inShow = true;
      } else {
        this.$toast(data.msg);
        this.$router.push(this.fun.getUrl('orderlist',{ status: '0', orderType: 'newBindBox' },{title: '我的盲盒'}));
      }
    },
    // 立即开箱
    clickUnpack() {
      this.newBlindBoxData = {
        api: 'plugin.new-blind-box.frontend.activity.open-box',
        order_id: this.$route.params.order_id
      }
      this.overlayShow = true;
    },
  },
  components: { bindBoxCard , payKeyboard , issueGoods },
};
